﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TheVerge.Base.Platform;

namespace TheVerge.Base.Models
{
    public class VMMedia : AVM, IPinnable
    {
        public const string ACTIVE_SECTION_QS = @"VMMedia.ActiveSection";

        public VMPhotos Photos { get; private set; }
        public VMPodcasts Podcasts { get; private set; }
        public VMVideos Videos { get; private set; }

        public IVMEntries ActiveSection { get; set; }

        public VMMedia(IAudioPlayer player)
        {
            Photos = new VMPhotos();
            Podcasts = new VMPodcasts(player);
            Videos = new VMVideos();
        }

        public string DisplayName
        {
            get
            {
                if (ActiveSection != null)
                    return ActiveSection.DisplayName;
                
                return @"Media";
            }
        }

        public Uri Tile { get { return new Uri(@"/Images/Tiles/Media.png", UriKind.Relative); } }

        public Dictionary<string, string> QueryStrings
        {
            get
            {
                var dic = new Dictionary<string, string>();
                if (ActiveSection != null)
                    dic.Add(ACTIVE_SECTION_QS, ActiveSection.DisplayName);
                return dic;
            }
        }

        public void LoadFromPin(Dictionary<string, string> queryStrings) { }
    }
}
